import Vue from 'vue'

let server = process.env.VUE_APP_RESTAURANTPCSERVICE;
let creategoodorderUrl = '/goodorder/creategoodorder';
let getNowAllUrl = '/useraddress/getaddresslist';
let addAddressUrl = '/useraddress/addaddress';
let modifyAddressUrl = '/useraddress/modifyaddress';
let getRedbagByStateUrl = '/redbagrecord/getByState';
let redbagUseUrl = '/redbagrecord/use';
let getloginUrl = '/user/getlogin';
let insertPointDetailUrl = '/pointdetail/insertPointDetail';
let removeInUrl = '/shoppingcartdetail/removeIn';
let getcurrentvipUrl = '/vip/getcurrentvip';


export default{
	creategoodorderService: function(paramsObj,callBack){
		Vue.axios.post(`${server}${creategoodorderUrl}`, paramsObj).then(res => {
			callBack(res.data);
		})
	},
	getNowAllService: function(callBack){
		Vue.axios.post(`${server}${getNowAllUrl}`).then(res => {
			callBack(res.data);
		})
	},
	addAddressService: function(paramsObj,callBack){
		Vue.axios.post(`${server}${addAddressUrl}`, paramsObj).then(res => {
			callBack(res.data);
		})
	},
	modifyAddressService: function(paramsObj,callBack){
		Vue.axios.post(`${server}${modifyAddressUrl}`, paramsObj).then(res => {
			callBack(res.data);
		})
	},
	getRedbagByStateService: function(paramsObj,callBack){
		Vue.axios.get(`${server}${getRedbagByStateUrl}`,{
			params: paramsObj
		}).then(res => {
			callBack(res.data);
		})
	},
	redbagUseService: function(paramsObj,callBack){
		Vue.axios.get(`${server}${redbagUseUrl}`,{
			params: paramsObj
		}).then(res => {
			callBack(res.data);
		})
	},
	getloginService: function(callBack){
		Vue.axios.post(`${server}${getloginUrl}`).then(res => {
			callBack(res.data);
		})
	},
	insertPointDetailService: function(paramsObj,callBack){
		Vue.axios.post(`${server}${insertPointDetailUrl}`, paramsObj).then(res => {
			callBack(res.data);
		})
	},
	removeInService: function(paramsObj,callBack){
		Vue.axios.post(`${server}${removeInUrl}`, paramsObj).then(res => {
			callBack(res.data);
		})
	},
	removeInService: function(paramsObj,callBack){
		Vue.axios.post(`${server}${removeInUrl}`, paramsObj).then(res => {
			callBack(res.data);
		})
	},
	getcurrentvipService: function(callBack){
		Vue.axios.post(`${server}${getcurrentvipUrl}`).then(res => {
			callBack(res.data);
		})
	},
}